﻿using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class RoomMap : MonoBehaviour, IPointerEnterHandler, IPointerClickHandler, IPointerExitHandler
{
    public Transform mapPanel;

    private void Start()
    {
        this.HideMapPanel();
    }

    public void OnPointerClick(PointerEventData eventData)
    {
        bool isActive = mapPanel.gameObject.activeSelf;
        if (!isActive)
            mapPanel.gameObject.SetActive(!isActive);
        this.mapPanel.DOLocalMoveY(0, .2f);
    }

    public void OnPointerEnter(PointerEventData eventData)
    {
        this.transform.DOScale(Vector3.one * 1.6f, .2f);
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        this.transform.DOScale(Vector3.one , .2f);
    }

    public void HideMapPanel()
    {
        this.mapPanel.DOLocalMoveY(1080, .2f);
    }
}
